//需求申请
//数据变更表
import cache from '/@/utils/hook/cache';
import commonRequest from '/@/api/common/common';
import { i18n } from '/@/locales/i18n';
const $t = i18n.global.t;

export default function (data: any) {
	const array = [
		{
			type: 'input',
			label: 'ID',
			key: 'id',
			value: data.id || '',
			disabledStyle: true,
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},

		{
			//日期不用传,使用创建日期
			type: 'input',
			label: $t('bai8wgKJtJcE67J1Op9H'),
			key: 'projectNo',
			value: data.projectNo || '',
			disabledStyle: true,
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},

		{
			type: 'input',
			label: $t('2x1ieg5LnH99mzT64hLn2'),
			key: 'materialID',
			value: data.materialID || '',
			disabledStyle: true,
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},

		{
			type: 'input',
			label: $t('knopsAvtsvLij4RUuPku'),
			key: 'materialName',
			value: data.materialName || '',
			disabledStyle: true,
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},

		{
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
			type: 'select',
			label: $t('diRe_2n7oLIxrZu7lQrIx'),
			key: 'staffName',
			value: data.staffName ? data.staffName : '',
			options: data.staffName ? [{ value: data.staffName, label: data.staffName }] : [],
			placeHolder: $t('1IdJIz8ljGphZHtaxcfJh'),
			selectOption: {
				type: 'remote',
				loading: false,
				requestMethod: commonRequest.getUserList,
				searchKey: 'SearchValue',
				value: 'jobNum',
				label: 'name',
				showMore: [
					{
						key: 'jobNum',
						label: $t('jXyNasyhWj25kGi7wJw'),
					},
				],
			},
			rules: [{ required: true, message: $t('p5ps6seAbIbjz7Dtquq6X'), trigger: ['blur', 'change'] }],
		},
	];
	return array;
}
